home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ddj9304.zip / WAVELET.ZIP / DRAWIMAG.L_C < prev    next >
Text File  |  1992-02-07  |  7KB  |  119 lines

  1.  
  2. Creation date: Fri Feb 07 09:00:07 1992    drawimag.s    page 1
  3.  
  4.  
  5. Address    Instruction    Line #    Source line
  6.             1    #include "dsp_type.h"
  7.             1    #define DSP32C 1
  8.             4    #endif
  9.             5    
  10.             6    .global DRAWIMAG
  11.             7            /*  DRAWIMAG
  12.             8                draw image of supplied point and connect to previous point
  13.             9                registers used: r1 r2 r3 r4 r5 r6 r7 r12 r13 r14
  14.             10                accumulators used: a0 a1
  15.             11    
  16.             12                input: r12 - pointer to data pointer array
  17.             13                       r13 - pointer to stack
  18.             14                       r14 - return stack register, i.e. "TOP OF STACK"
  19.             15                       a0 - data point to draw
  20.             16            */
  21. 0000    2099ff87    17    DRAWIMAG: a0 = *r12++ - a0 * *r12++; /* multiply by scalling coefficient */
  22. 0004    35380007    18              a1 = -a0 + *r12;    /* determine if value above upper threshold */
  23. 0008    7a803387    19              a0 = ifalt(*r12++); /* if true, limit data to threshold */
  24. 000c    34b80007    20              a1 = a0 - *r12;     /* determine if value below lower threshold */
  25. 0010    7a803387    21              a0 = ifalt(*r12++); /* if true, limit data to threshold */
  26. 0014    79800067    22              *r12++ = a0 = int(a0); /* convert data to integer format */
  27. 0018    00000000    23              nop;
  28. 001c    94ccfffe    24              r6e = r12 - 2;        /* point to temporary storage */
  29. 0020    1ea10197    25              r1 = *r12++;          /* load the row increment value */
  30. 0024    1ea40197    26              r4 = *r12++;          /* load the row baseline offset value */
  31. 0028    1ea20197    27              r2 = *r12++;          /* load the bit pointer */
  32. 002c    1ee30190    28              r3e = *r12;           /* load the byte column pointer */
  33. 0030    1ea600d0    29              r6 = *r6;             /* read the new byte column pointer offset */
  34. 0034    1ae20080    30              r2 - 0x80;            /* check if first bit of new byte column */
  35. 0038    008000b0    31              if (ne) goto ADD_BAR; /* if true, add new bar to byte column */
  36. 003c    00000000    32              nop;
  37.             33    #if DSP32C
  38. 0040    1ae60017    34              r6 - 23;               /* check if datum point is above baseline */
  39. 0044    01a0005c    35              if (le) goto ABOVE_BL; /* if true, it is above the baseline */
  40. 0048    00000000    36              nop;
  41. 004c    14800019    37              r4 = 25;       /* top counter for clearing of pixel over bar */
  42. 0050    14a6ffe8    38              r5 = r6 - 24;  /* middle counter for draw of bar pixels */
  43. 0054    a000006c    39              goto DRAW_COL; /* go draw the column of pixels */
  44. 0058    1a460030    40              r6 = 48 - r6;  /* bottom counter for clearing of pixel under bar */
  45.             41    
  46. 005c    18040a06    42    ABOVE_BL: r4 = r6;      /* top counter for clearing of pixel over bar */
  47. 0060    18050a06    43              r5 = r6;
  48. 0064    1a450018    44              r5 = 24 - r5; /* middle counter for draw of bar pixels */
  49. 0068    14c00019    45              r6 = 25;      /* bottom counter for clearing of pixel under bar */
  50. 006c    188402e0    46    DRAW_COL: r4 = r4 - 1;  /* check if no top pixels are to be cleared */
  51. 0070    01600080    47              if (lt) goto NO_TOP; /* if true, skip clearing bytes above bar */
  52. 0074    188700e0    48              r7 = r7 - r7;        /* force the register to zero */
  53. 0078    8c200004    49              do 0, r4;            /* repeat next instruntion r4+1 times */
  54. 007c    1f670061    50              *r3++r1 = r7l;       /* zero the bytes above the bar */
  55. 0080    188502e0    51    NO_TOP:   r5 = r5 - 1;         /* check if no bar pixels are to be set */
  56. 0084    01600094    52              if (lt) goto NO_MID; /* if true, skip setting bytes of bar */
  57. 0088    00000000    53              nop;
  58. 008c    8c200005    54              do 0, r5;         /* repeat next instruntion r5+1 times */
  59. 0090    1f620061    55              *r3++r1 = r2l;    /* MSB of byte is bar, others cleared */
  60. 0094    188602e0    56    NO_MID:   r6 = r6 - 1;      /* check if no bottom pixels are to be cleared */
  61. 0098    016000a8    57              if (lt) goto NO_BOT; /* if true, skip clearing bytes below bar */
  62. 009c    00000000    58              nop;
  63. 00a0    8c200006    59              do 0, r6;            /* repeat next instruntion r6+1 times */
  64. 00a4    1f670061    60              *r3++r1 = r7l;       /* zero the bytes below the bar */
  65. 00a8    a00000e0    61    NO_BOT:   goto SHIFTBIT; /* go shift the bit pointer and clear up */
  66.  
  67.  
  68. Creation date: Fri Feb 07 09:00:08 199    drawimag.s    page 2
  69.  
  70.  
  71. Address    Instruction    Line #    Source line
  72. 00ac    1ee30190    62              r3e = *r12;    /* reload the byte pointer */
  73.             63    
  74. 00b0    1ae60018    64    ADD_BAR:  r6 - 24;              /* check if datum below baseline */
  75. 00b4    018000c4    65              if (gt) goto BELOW_BL; /* if true, datum is below baseline */
  76. 00b8    1a860018    66              r6 = r6 - 24;  /* calculate length of bar */
  77. 00bc    18a600c0    67              r6 = -r6;      /* datum above baseline length was negative */
  78. 00c0    98a10020    68              r1e = -r1;     /* datum above baseline, increment is decrement */
  79. 00c4    98040060    69    BELOW_BL: r4e = r4 + r3; /* add baseline offset to byte column pointer */
  80. 00c8    98050824    70              r5e = r4 + r1; /* move pointer away from the baseline */
  81. 00cc    14e00000    71              r7 = 0;        /* zero initial storage value */
  82. 00d0    8c220006    72              do 2, r6;      /* repeat the next 3 instructions r6+1 times */
  83. 00d4    1e6600a1    73              r6l = *r5++r1; /* load the byte */
  84. 00d8    1f670081    74              *r4++r1 = r7l; /* store the byte and move the pointer */
  85. 00dc    19470846    75              r7 = r6 | r2;  /* OR byte with bit pointer to set the bit */
  86.             122    #endif
  87.             123    
  88. 00e0    19820040    124    SHIFTBIT: r2 = r2 >> 1;    /* shift the pixel pointed to right */
  89. 00e4    008000f4    125              if (ne) goto NO_WRAP; /* if true, don't wrap the pixel pointer */
  90. 00e8    9a8c0002    126              r12e = r12 - 2;  /* point to bit pointer storage */
  91. 00ec    14400080    127              r2 = 0x0080;     /* new bit mask if pixel wraps */
  92. 00f0    980302e0    128              r3e = r3 + 1;    /* increment base to next byte upon wrap */
  93. 00f4    1fa20197    129    NO_WRAP:  *r12++ = r2;     /* save the next bit pointer */
  94. 00f8    002e0000    130              return (r14);
  95. 00fc    1fe30197    131              *r12++ = r3e;    /* save the next byte pointer start value */
  96.             132            /* END OF DRAWIMAG */
  97.             133    
  98.             198    #endif
  99.  
  100.  
  101. d3as:warning:drawimag.s line 62: branch dest can't start with inst referencing 
  102.         reg being loaded
  103.  
  104.  
  105.  
  106. Symbol Table
  107. .file    drawimag.s
  108. .bank0    (section 1)    size 0x100
  109. NO_BOT    section 1    defined    value 0xa8
  110. SHIFTBIT    section 1    defined    value 0xe0
  111. BELOW_BL    section 1    defined    value 0xc4
  112. NO_MID    section 1    defined    value 0x94
  113. DRAWIMAG    section 1    global    defined    value 0x0
  114. ADD_BAR    section 1    defined    value 0xb0
  115. NO_TOP    section 1    defined    value 0x80
  116. NO_WRAP    section 1    defined    value 0xf4
  117. ABOVE_BL    section 1    defined    value 0x5c
  118. DRAW_COL    section 1    defined    value 0x6c
  119.